﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel.DataAnnotations;

namespace Shop.Backstage.Models
{
    public class AdminInfo
    {
        /// <summary>
        /// 管理员ID
        /// </summary>
        public int AID { get; set; }
        /// <summary>
        /// 用户名
        /// </summary>
        [Required(AllowEmptyStrings = false, ErrorMessage = "账号不能为空!")]
        [RegularExpression(@"^[a-zA-Z0-9]*$", ErrorMessage = "只能输入英文和数字!")]
        [StringLength(30, ErrorMessage = "账号位数不大于30!")]
        public string AName{ get; set; }
        /// <summary>
        /// 登录密码
        /// </summary>
        [Required(AllowEmptyStrings = false, ErrorMessage = "密码不能为空!")]
        [RegularExpression(@"^[a-zA-Z0-9]*$", ErrorMessage = "只能输入英文和数字!")]
        [StringLength(16, ErrorMessage = "密码位数不大于16!")]
        public string APass { get; set; }
        /// <summary>
        /// 电话号码
        /// </summary>
        public string Tel { get; set; }
        /// <summary>
        /// 注册时间
        /// </summary>
        public DateTime CreateDate { get; set; }
    }
}
